import { request } from '@/plugins/request';

// 登录
export function login(data) {
  return request({
    method: 'POST',
    url: '/api/users/login',
    data
  });
}

// 注册
export function register(data) {
  return request({
    method: 'POST',
    url: '/api/users',
    data
  });
}

// 更新用户资料
export function updateUser(data) {
  if (!data.password) delete data.password;
  return request({
    method: 'PUT',
    url: '/api/user',
    data
  });
}